// Decompiled by GOOSIN CO,LTD Copyright 2010 Pavel Kouznetsov.
// home page: http://www.Goosin.net
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   strategyClass_delete_ok.java

package crm.config.file;

import include.nseer_db.nseer_db_backup1;
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.ResultSet;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.*;
import javax.servlet.jsp.JspFactory;

public class strategyClass_delete_ok extends HttpServlet
{

	ServletContext application;
	HttpSession session;
	nseer_db_backup1 erp_db;

	public strategyClass_delete_ok()
	{
		erp_db = null;
	}

	public synchronized void service(HttpServletRequest request, HttpServletResponse response)
		throws IOException, ServletException
	{
		HttpSession dbSession = request.getSession();
		JspFactory _jspxFactory = JspFactory.getDefaultFactory();
		javax.servlet.jsp.PageContext pageContext = _jspxFactory.getPageContext(this, request, response, "", true, 8192, true);
		ServletContext dbApplication = dbSession.getServletContext();
		try
		{
			HttpSession session = request.getSession();
			PrintWriter out = response.getWriter();
			nseer_db_backup1 crm_db = new nseer_db_backup1(dbApplication);
			if (crm_db.conn((String)dbSession.getAttribute("unit_db_name")))
			{
				String sqll = "select * from crm_config_public_char order by type_ID";
				ResultSet rs = crm_db.executeQuery(sqll);
				rs.next();
				rs.last();
				int intRowCount = rs.getRow();
				String del[] = new String[intRowCount];
				del = (String[])session.getAttribute("del");
				if (del != null)
				{
					for (int i = 1; i <= intRowCount; i++)
						try
						{
							if (del[i - 1] != null)
							{
								String sql = (new StringBuilder("delete from crm_config_public_char where id='")).append(del[i - 1]).append("'").toString();
								crm_db.executeUpdate(sql);
							}
						}
						catch (Exception ex)
						{
							out.println((new StringBuilder("error")).append(ex).toString());
						}

				}
				response.sendRedirect("crm/config/file/strategyClass.jsp");
				crm_db.commit();
				crm_db.close();
			} else
			{
				response.sendRedirect("error_conn.htm");
			}
		}
		catch (Exception exception) { }
	}
}
